package com.eco.mam.work.request.transform;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Scanner;

import javanet.staxutils.IndentingXMLStreamWriter;

import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;

import org.apache.log4j.Logger;

import com.eco.mam.work.ConfigParameters;
import com.eco.mam.work.DataException;
import com.eco.mam.work.request.RequestMap;
import com.eco.mam.work.request.ResponseMap;
import com.eco.mam.work.request.dto.WorkRequest;
import com.eco.mam.work.request.resource.WorkRequestConfig;

/*This is core class which is responsible for transorming 
 * the csv file into an xml representaion*/
public class XMLTransformer {

    static final Logger logger = Logger.getLogger(XMLTransformer.class);

    /*
     * This method will transform a (Work Request) csv file into an xml.
     */
    public StringWriter transform(ArrayList<String[]> strCsvTokensList)
            throws DataException {
        StringWriter stringWriter = new StringWriter();
        logger.debug("entering XMLTransformer.transform()");
        stringWriter = new XMLTransformUtils()
                .createXMLDocumentAsStringWriterFromCsvTokens(strCsvTokensList);
        return stringWriter;
    }

}
